<script setup lang="ts">
const name = "template"
import { Star } from "@element-plus/icons-vue";
import {ref , onMounted , toRefs} from "vue"
import router from "@/router";
import {usePiniaStore} from "@/store"


// 2 拿到实例
const piniaStore = usePiniaStore();
// 3 解构里面的变量和方法 toRefs作用是让解构出来的变量具有响应性
// 4 如果直接调用，则不需要解构出来，直接使用势力方法就行
const { num,changeNum } = toRefs(piniaStore);


onMounted(() => {
  console.log('_______')

})

const count = ref(0)
const counter = ref(0)

</script>

<template>
  <div>
    <el-button type="warning" :icon="Star" circle >{{ name }}</el-button>
  </div>  
</template>

<style scoped lang="scss">

</style>